import { IBaseTable } from './atom/db/interfaces';
import update from './atom/db/update';

declare const action_id: string;
declare const session_id: string;
declare const spaceid: string;

interface Message {
	_id: string,
	deptname: string
}

async function atom(msg: Message) {
	const { exec, prepare } = update(action_id, session_id, spaceid, '6051');
	prepare('dept', [msg]);
	const ret = await exec();
	if (ret.code === 1) {
		return 'success';
	} else {
		return 'fail';
	}
}
